package io.github.talelin.latticy.model.oms;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.github.talelin.latticy.common.enumeration.InboundOrderBoxModelEnum;
import io.github.talelin.latticy.dto.oms.inbound_order.InboundPackagesDTO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 入库单打包箱bean
 *
 * @author generator@TaleLin
 * @since 2022-05-18
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@TableName(value = "t_inbound_packages",excludeProperty="inboundPackagesItemsList")
public class InboundPackagesDO{

    @TableId(value = "package_no", type = IdType.INPUT)
    private String packageNo;
    /**
     * 入库单id
     */
    private String inboundOrderNo;

    /**
     * 箱子型号(1.大 2.中 3.小 4.特大)
     */
    private InboundOrderBoxModelEnum boxModel;
    /**
     * 尺寸单位类型
     */
    private Integer distanceUnit;

    /**
     * 重量单位类型
     */
    private Integer massUnit;

    /**
     * 箱子数量
     */
    private Integer quantity;
    /**
     *标品数
     */
    private Integer specimen;

    /**
     * 破损数
     */
    private Integer damaged;

    /**
     * 已接收箱子数量
     */
    private Integer receiveQuantity;

    /**
     * 单箱重量
     */
    private BigDecimal weight;


    /**
     * 打包箱入库单号
     */
    private String trackingNumber;

    /**
     * 长
     */
    private BigDecimal length;

    /**
     * 宽
     */
    private BigDecimal height;

    /**
     * 高
     */
    private BigDecimal width;

    /**
     * 备注
     */
    private String otherRemark;

    @JsonIgnore
    private Date createTime;

    @JsonIgnore
    private Date updateTime;

    @TableLogic
    @JsonIgnore
    private Date deleteTime;

    private List<InboundPackagesItemsDO> inboundPackagesItemsList;

    public InboundPackagesDO(InboundPackagesDTO inboundPackagesDTO, String packageNo) {
        BeanUtils.copyProperties(inboundPackagesDTO, this);
        this.packageNo = packageNo;
    }
}
